Fgetchar

Section: Oct. 1, 1991 (2)
Updated: MiNT Programmer's Manual
Index Return to Main Contents
 

NAME

Fgetchar - read a character from a file  

SYNOPSIS

LONG Fgetchar( WORD fh, WORD mode );
 

DESCRIPTION

Fgetchar reads a character from the open file whose handle is fh. The parameter mode has an effect only if the open file is a terminal or pseudo-terminal, in which case the bits of mode have the following meanings:
0x0001
Cooked mode; special control characters (control-C and control-Z) are checked for and interpreted if found (they cause SIGINT and SIGTSTP, respectively, to be raised); also, flow control with control-S and control-Q is activated.
0x0002
Echo mode; characters read are echoed back to the terminal.

The ASCII value of the character read is put in the low byte of the long word that is returned. If the file is a terminal or pseudo-terminal, the scan code of the character pressed and (possibly) the shift key status are also returned in the long word, just as with the BIOS Bconin system call.  

RETURNS

The character read, if successful.

0x0000FF1A if end of file is detected.

EIHNDL if fh is not a valid handle for an open file.  

SEE ALSO

Bconin(2), Cconin(2), Cauxin(2), Fputchar(2), Fread(2)


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURNS
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 11:14:12 GMT, June 22, 2025